vpath %.cpp ./

CXX = g++ -g
vpeTranscode = libvpe_transcode
vpeTranscodeObjs = \
vpe_transcode.o \
input_stream.o \
output_stream.o \
codec.o \
video_decoder.o \
video_encoder.o \
audio_decoder.o \
audio_encoder.o \
video_process.o \
audio_process.o \
smbPitchShift.o \
face_dection.o 


all:$(vpeTranscode) 

OBJS = $(vpeTranscodeObjs) 

FFMPEG_LIBS=libavcodec libavdevice libavfilter libswscale libavutil libavformat libswresample

CFLAGS+=-g -fPIC -Wl,--as-needed -Wl,-rpath='./' -Wl,--whole-archive -Wl,--no-whole-archive -Wl,--whole-archive /usr/lib/vpe/libhugetlbfs.a  -Wl,--no-whole-archive -I /include -I ./
LDFLAGS+= -L /lib -L /usr/lib/vpe
libs = -lpthread -lz -lavdevice -lavfilter -lavformat -lavcodec -lswscale -lswresample -lavutil -lyuv -lvpi -lvpedecode -lvpeencode -lg2h264 -lg2hevc -lg2vp9 -lpp  -ldwlg2 -lg2common -lh2enc -lstdc++ -lsyslog -lhal -lhugetlbfs -lm -ldl 
$(vpeTranscode) : $(vpeTranscodeObjs)
	#$(CXX)  $(vpeDecodeObjs) $(CFLAGS) $(LDFLAGS) $(libs) -o $(vpeDecode)
	#$(CXX)  $(vpeDecodeObjs) $(CFLAGS) $(LDFLAGS) $(libs) -o vpe_decode
	$(CXX)  $(vpeTranscodeObjs) $(CFLAGS) $(LDFLAGS) $(libs) -o vpe_transcode


$(OBJS): %.o : %.cpp
	$(CXX) $< $(CFLAGS)  -c -o $@

clean:
	rm -rf *.o $(vpeTranscode) vpe_transcode

check-syntax:
	$(CXX) $(CFLAGS) $(LDFLAGS) -o nul -S ${CHK_SOURCES}
